#ifndef SM2_H
#define SM2_H


#if (CRYPTO_ALGORITHM_SM2 == STD_ON)
#include "Crypto_Types.h"

#include "sm2_enc.h"
#include "sm2_sign.h"


typedef SM2_Signer_Info Crypto_SM2_Signer_Info;

typedef

#define SM2_ENCRYPT 0x1 	/**< SM2 encryption */
#define SM2_DECRYPT 0x2		/**< SM2 decryption */
#define SM2_SIGN    0x3		/**< SM2 signing data */
#define SM2_VERIFY  0x4		/**< SM2 signature verification */

#define SM2_ENC_MODE_ECB 0x11

FUNC(Std_ReturnType, CRY_CODE)
Crypto_sm2_setkey_enc(P2VAR(uint8, AUTOMATIC, CRY_APPL_DATA) key); 		/** Setup public key for SM2 encryption */
FUNC(Std_ReturnType, CRY_CODE)
Crypto_sm2_setkey_dec(P2VAR(uint8, AUTOMATIC, CRY_APPL_DATA) key);		/** Setup public key for SM2 decryption */

FUNC(Std_ReturnType, CRY_CODE)
Crypto_sm2_signature_generate(Crypto_SM2_Signer_Info *signer, const uint8_t *message, const uint32_t message_size, SM2_Signature *output);	/** SM2 Signature generate */
FUNC(Std_ReturnType, CRY_CODE)
Crypto_sm2_signature_verify(const uint8_t sig[64], const uint8_t pub[64], const uint8_t Z_A[32], const uint8_t *message, uint32_t message_size);

FUNC(Std_ReturnType, CRY_CODE) Crypto_SM2EncryptECB(P2VAR(uint8, AUTOMATIC, CRY_APPL_DATA) key, uint8 buf[64]);
FUNC(Std_ReturnType, CRY_CODE) Crypto_SM2DecryptECB(P2VAR(uint8, AUTOMATIC, CRY_APPL_DATA) key, uint8 buf[64]);




#endif /* CRYPTO_ALGORITHM_SM2 == STD_ON */
#endif /* sm2.h */
